package com.mooc.yohoshop.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.mooc.yohoshop.entity.OffLineCarEntity;
import com.mooc.yohoshop.entity.UserValuesEntity;

import com.mooc.yohoshop.dao.OffLineCarEntityDao;
import com.mooc.yohoshop.dao.UserValuesEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig offLineCarEntityDaoConfig;
    private final DaoConfig userValuesEntityDaoConfig;

    private final OffLineCarEntityDao offLineCarEntityDao;
    private final UserValuesEntityDao userValuesEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        offLineCarEntityDaoConfig = daoConfigMap.get(OffLineCarEntityDao.class).clone();
        offLineCarEntityDaoConfig.initIdentityScope(type);

        userValuesEntityDaoConfig = daoConfigMap.get(UserValuesEntityDao.class).clone();
        userValuesEntityDaoConfig.initIdentityScope(type);

        offLineCarEntityDao = new OffLineCarEntityDao(offLineCarEntityDaoConfig, this);
        userValuesEntityDao = new UserValuesEntityDao(userValuesEntityDaoConfig, this);

        registerDao(OffLineCarEntity.class, offLineCarEntityDao);
        registerDao(UserValuesEntity.class, userValuesEntityDao);
    }
    
    public void clear() {
        offLineCarEntityDaoConfig.clearIdentityScope();
        userValuesEntityDaoConfig.clearIdentityScope();
    }

    public OffLineCarEntityDao getOffLineCarEntityDao() {
        return offLineCarEntityDao;
    }

    public UserValuesEntityDao getUserValuesEntityDao() {
        return userValuesEntityDao;
    }

}
